﻿using System;


class Program
{
    static void Main()
    {
        char[] FirstCharArray = { 'y', 'r', 'q', 'a', 'c', '7', '@', '-' };
        Array.Sort(FirstCharArray);
        for (int i = 0; i < FirstCharArray.Length; i++)
        {
            Console.SetCursorPosition(0, i);
            Console.Write(FirstCharArray[i]);       //you can see how its look when is sorted
        }
        char[] SecondCharArray = { '6', 'o', 'g', 't', 'm', 'c', 's', 'a', 'r', '7', 'q', '-' };
        Array.Sort(SecondCharArray);
        for (int j = 0; j < SecondCharArray.Length; j++)
        {
            Console.SetCursorPosition(2, j);
            Console.Write(SecondCharArray[j]);      //you can see how its look when is sorted
        }
        Console.WriteLine();
        int SmallerArray = new int();
        if (FirstCharArray.Length > SecondCharArray.Length)
        {
             SmallerArray = SecondCharArray.Length;
        }
        else // if SecondCharArray.Lenght == FirstCharArray.Lenght its dosent matter witch will be for SmallerArray
        {
             SmallerArray = FirstCharArray.Length;
        }
        int LexicographicalLenght = 0;
        int DifferentChar = new int();

        for (int i = 0; i < SmallerArray; i++)
        {
            if (FirstCharArray[i] != SecondCharArray[i])
            {
                DifferentChar = i;
                if (FirstCharArray[i] < SecondCharArray[i])
                {
                    LexicographicalLenght = 1;
                }
                else
                {
                    LexicographicalLenght = 2;
                }
                break;
            }
        }
        if (LexicographicalLenght == 0 && FirstCharArray.Length == SecondCharArray.Length)
        {
            Console.WriteLine("First and second char arrays are equal");
        }
        else if (LexicographicalLenght == 0 && FirstCharArray.Length < SecondCharArray.Length)
        {
            Console.WriteLine("First char array are early in Lexicographical order");
        }
        else if (LexicographicalLenght == 0 && FirstCharArray.Length > SecondCharArray.Length)
        {
            Console.WriteLine("Second char array are early in Lexicographical order");
        }
        else if (LexicographicalLenght == 1)
        {
            Console.WriteLine("First char array are early in Lexicographical order , beacouse {0} is before {1}"
                , FirstCharArray[DifferentChar], SecondCharArray[DifferentChar]);
        }
        else
        {
            Console.WriteLine("Second char array are early in Lexicographical order , beacouse {0} is before {1}"
                , SecondCharArray[DifferentChar], FirstCharArray[DifferentChar]);
        }
			
    }
}